// JavaScript Document

function inc(filename)
{
	var body = document.getElementsByTagName('head').item(0);
	script = document.createElement('script');
	script.src = filename;
	script.type = 'text/javascript';
	body.appendChild(script)
}
if (typeof jQuery == 'undefined') {
	//inc("http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js");
}
jQuery(document).ready(function() {
	// See if we have a member logged in
	
	addMemberInfo();
	
	// Turn on IE's backgroundImageCache feature to prevent hover flicker
	try {
		document.execCommand('BackgroundImageCache', false, true);
	} catch(e) {}
	
});





/**
* Determines if a member is logged in and updates the page
* for printing out personalized content
*/



function addMemberInfo()
{
	
	if (cookie = getCookie('memberInfo'))
	{	
		
		var member = cookie.parseJSON();
		//var member = eval(cookie);
		
		// Add class to body tag
		
		$("body").addClass('memberLogin');
		
		// Create and insert the memberInfo div
		var memberDiv = document.createElement('div');
		memberDiv.id = 'memberInfo';
		$('#main').prepend(memberDiv);
		
		// Create the contents of the memberInfo div
		memberDiv.innerHTML = '\n\
		<h1>' + member.organization + '</h1>\n\
		<h2>' + member.name + '</h2>\n\
		<p>' + member.address + '<br>\n' + member.location + '<br>\n' + member.phone + '</p>\n';
	}
}



/**
* Function for writing current date to document
*/
function wrtdate()
{
	var mydate=new Date()
	var year=mydate.getFullYear()
	var day=mydate.getDay()
	var month=mydate.getMonth()
	var daym=mydate.getDate()
	var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday", "Friday","Saturday")
	var montharray=new Array("1","2","3","4","5","6"
	,"7","8","9","10","11","12")
	document.write(dayarray[day]+", "+montharray[month]+"/"+daym+"/"+year)
}


/*  Prototype JavaScript framework
 *  (c) 2005 Sam Stephenson <sam@conio.net>
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://prototype.conio.net/
/*--------------------------------------------------------------------------*/

//note: modified & stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net).




///  Deleted all of the prototype stuff  Findout what it was for and add back in only if absolutly needed ///

function setCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+escape(value)+expires+"; path=/";
}

function getCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return unescape(c.substring(nameEQ.length,c.length).replace(/\+/g,  " "));
	}
	return null;
}

function deleteCookie(name){ setCookie(name,"",-1) }




String.prototype.parseJSON = function () { try { return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test( this.replace(/"(\\.|[^"\\])*"/g, ''))) && eval('(' + this + ')'); } catch (e) { return false; } };

// Ad stuff

//------  BEGIN OAS SETUP ------>
//configuration


//-->






